<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>如何遍历数组</title>
    <script src="../jquery-1.7.2.js"></script>
</head>
<body>
<script>
$(function(){
    var myData = {
        'root':{
            'num':[1,2,3],
            'lett':['a','b','c'],
            'mir':['tomatoes','carrots','potatoes']
        }
    };
    console.log(myData);
    console.log(myData.root);
    console.log(myData.root.num);

//    遍历数组并取出mir
    var animalString = "";
    for (var i = 0; i < myData.root.num.length; i++) {
        animalString += myData.root.num[i] + " ";
    }
    console.log(animalString);
})
</script>
</body>
</html>